#include "Student_info.h"
#include <iterator>
#include <algorithm> 
#include "grade.h"
#include "median.h"
#include "average.h"

using namespace std;


double median_analysis(const vector<Student_info>& students)
{
	vector<double> grades;

	transform(students.begin(), students.end(),
		back_inserter(grades), grade_aux);
	return median(grades);
}

double average_analysis(const vector<Student_info>& students)
{
	vector<double> grades;

	transform(students.begin(), students.end(),
		back_inserter(grades), average_grade);
	return median(grades);
}

double optimistic_median_analysis(const vector<Student_info>& students)
{
	vector<double> grades;

	transform(students.begin(), students.end(),
		back_inserter(grades), optimistic_median);
	return median(grades);
}

